[Linux]Change title of a window

Share your advanced PureBasic knowledge/code with the community.
Christian
Enthusiast
Enthusiast
Posts: 154
Joined: Mon Dec 08, 2003 7:50 pm
Location: Germany

[Linux]Change title of a window

Post by Christian »

Code updated for 5.20+ (same as SetWindowTitle())

Hi again!

Here is some small code for changing the title of a window.

Code: Select all

hnd = OpenWindow(0, 0, 0, 300, 300, "Change Window Title", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If hnd
  ButtonGadget(0, 50, 50, 100, 25, "Change Title")
  
  Repeat
    Select WaitWindowEvent()
      Case #PB_Event_Gadget
        Select EventGadget()
          Case 0
            NewTitle.s = InputRequester("Change Title", "Please enter a new title ...", "")
            If NewTitle.s <> ""
              gtk_window_set_title_(hnd, NewTitle.s)
            EndIf
        EndSelect
        
      Case #PB_Event_CloseWindow
        quit = 1
    EndSelect
    
  Until quit = 1
EndIf

End
regards,
Christian
USCode
Addict
Addict
Posts: 924
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

GetWindowTitle(), SetWindowTitle()

Post by USCode »

As of 3.90, there are formal non-API functions to accomplish this now ... assuming these functions make it to the Linux 3.90 version.

GetWindowTitle(#Window), SetWindowTitle(#Window,$Title)
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Re: GetWindowTitle(), SetWindowTitle()

Post by sec »

do you have a update to 3.90 for linux :D
USCode wrote:As of 3.90, there are formal non-API functions to accomplish this now ... assuming these functions make it to the Linux 3.90 version.

GetWindowTitle(#Window), SetWindowTitle(#Window,$Title)
USCode
Addict
Addict
Posts: 924
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Post by USCode »

USCode:
assuming these functions make it to the Linux 3.90 version
sec:
do you have a update to 3.90 for linux
No one does yet. :wink:
Last edited by USCode on Thu Apr 15, 2004 4:09 pm, edited 1 time in total.
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Post by sec »

damm, I (& You) Hope linux version will soon release (that mean)
USCode
Addict
Addict
Posts: 924
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

I guess we can't rush an artist...

Post by USCode »

Yep, I'm looking forward to the 3.90 Linux release as well but like the old saying says "you can't rush art" ... or something like that... :wink:
Hopefully, that art will include using GTK+2.0.
Post Reply