[PB5.60] DisableWindow doesn't work

Post bugreports for the Linux version here
User avatar
marcoagpinto
Addict
Addict
Posts: 939
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

[PB5.60] DisableWindow doesn't work

Post by marcoagpinto »

Hello!

I was just testing Proofing Tool GUI compiling in Ubuntu 17.04 x86.

I found two bugs but for now I will only report this one.

When I open a window over the main window and disable the main window, the main window doesn't get disabled (it continues clickable).

Code: Select all


#WINDOW_MAIN=1
#WINDOW_ADD_EDIT=2


window_resolution=1280
If OpenWindow(#WINDOW_MAIN,0,0,window_resolution,600,"Proofing Tool GUI",#PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)=#False : MessageRequester("Error", "Can't open a window.", 0) : EndIf


t$="Add/Edit words in the dictionary"
If OpenWindow(#WINDOW_ADD_EDIT,0,0,(1024-800)+(800-640)+640-10,200-50-20-20+100+100+200-30-30-30+10+120,t$,#PB_Window_WindowCentered,WindowID(#WINDOW_MAIN))=0 : MessageRequester("Error", "Can't open a window.") : EndIf
DisableWindow(#WINDOW_MAIN,#True)


cancel=#False
Repeat
  
      event=WaitWindowEvent()
      
      
      ; Pressed the close window gadget (Ubuntu)
      If event=#PB_Event_CloseWindow
        cancel=#True     
      EndIf     
      
Until cancel=#True 
    
User avatar
Kiffi
Addict
Addict
Posts: 1353
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: [PB5.60] DisableWindow doesn't work

Post by Kiffi »

confirmed.

Code: Select all

#WINDOW_MAIN=1
#WINDOW_ADD_EDIT=2

OpenWindow(#WINDOW_MAIN,0,0,600,600,"parent", #PB_Window_ScreenCentered)

OpenWindow(#WINDOW_ADD_EDIT,0,0,400,400,"child",#PB_Window_ScreenCentered, WindowID(#WINDOW_MAIN))

DisableWindow(#WINDOW_MAIN,#True)

Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
Greetings Peter (Linux Mint 18.1 Serena / Cinnamon 3.2.7 (Gtk 3.18.9) / PB5.60 (x64))
Hygge
Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [PB5.60] DisableWindow doesn't work

Post by Fred »

Seems like gtk_widget_set_sensitive_() doesn't work anymore for gtk window in GTK3
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Re: [PB5.60] DisableWindow doesn't work

Post by Justin »

gtk_window_set_modal_() disables the parent window, although you can still resize or hide it.
Another thing i noticed is that the child window still appears in the taskbar, is this normal? i don't use linux too much but in windows doesn´t.
I tried gtk_window_set_skip_taskbar_hint_() but does not work, only gtk_window_set_skip_pager_hint_() works.
Linux Mint 17 64

Code: Select all

#WINDOW_MAIN=1
#WINDOW_ADD_EDIT=2


window_resolution=1280
If OpenWindow(#WINDOW_MAIN,0,0,window_resolution,600,"Proofing Tool GUI",#PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)=#False : MessageRequester("Error", "Can't open a window.", 0) : EndIf


t$="Add/Edit words in the dictionary"
If OpenWindow(#WINDOW_ADD_EDIT,0,0,(1024-800)+(800-640)+640-10,200-50-20-20+100+100+200-30-30-30+10+120,t$,#PB_Window_WindowCentered | #PB_Window_Invisible,WindowID(#WINDOW_MAIN))=0 : MessageRequester("Error", "Can't open a window.") : EndIf
;DisableWindow(#WINDOW_MAIN,#True)
gtk_window_set_modal_(WindowID(#WINDOW_ADD_EDIT), #True)
gtk_window_set_skip_taskbar_hint_(WindowID(#WINDOW_ADD_EDIT), #True) ;only works if the window is not shown
gtk_window_set_skip_pager_hint_(WindowID(#WINDOW_ADD_EDIT), #True) ;works
HideWindow(#WINDOW_ADD_EDIT, #False)


cancel=#False
Repeat
 
      event=WaitWindowEvent()
     
     
      ; Pressed the close window gadget (Ubuntu)
      If event=#PB_Event_CloseWindow
        cancel=#True     
      EndIf     
     
Until cancel=#True
Last edited by Justin on Sat Aug 19, 2017 8:33 pm, edited 1 time in total.
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Re: [PB5.60] DisableWindow doesn't work

Post by Justin »

I found the soultion for the taskbar thing, gtk_window_set_skip_taskbar_hint() must be called before the window is shown. I edited the code.
Could this somehow be fixed adding some option or watever for the next version without using api?
Post Reply